
#include "MathExtra.h"

float MathExtra::Lerp(float start,float end, float value)
{
	return ((end-start)*value)+start;
}
float MathExtra::Clamp(float value,float max, float min)
{
		if(value < min){value = min;}
		if(value > max){value = max;}
		return value;
}
float MathExtra::Abs(float value)
{
	return value*Sign(value);
}
float MathExtra::DegToRad(float value)
{
	return value*0.0174532925f;
}
float MathExtra::RadToDeg(float value)
{
	return value*57.2957795f;
}
float MathExtra::Sign(float value)
{
	float sign = 0;
	if(value < 0){sign = -1;}
	if(value > 0){sign = 1;}
	return sign;
}
	const float MathExtra::Pi =			3.141593f;
	const float MathExtra::TwoPi =		6.283185f;
	const float MathExtra::PiOver2 =	1.570796f;
	const float MathExtra::PiOver4 =	0.785398f;